package com.ruoyi.user.controller;

import com.ruoyi.common.core.domain.IdVo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.UserLogVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.user.service.TbUserLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 咸鱼
 * @version 1.0
 * @description: TODO
 * @date 2023/1/13 14:08
 */
@RestController
@RequestMapping("/user_log")
public class TbUserLogController {

    @Autowired
    private TbUserLogService tbUserLogService;

    @PostMapping("/addUserLog")
    public R addUserLog(@RequestBody UserLogVo userLogVo){
        return tbUserLogService.addUserLog(userLogVo);
    }

    @DeleteMapping("deleteUserLogById")
    public R deleteUserLogById(@RequestBody IdVo idVo){
        return tbUserLogService.deleteUserLogById(idVo);
    }

    @PostMapping("selectUserLogByUserId")
    public AjaxResult selectUserLogByUserId(@RequestBody IdVo idVo){
        return tbUserLogService.selectUserLogByUserId(idVo);
    }

    @PostMapping("/updateUserLog")
    public R updateUserLog(@RequestBody UserLogVo userLogVo){
        return tbUserLogService.updateUserLog(userLogVo);
    }
}
